import React, { useEffect, useState, useImperativeHandle } from "react";
import { View, Text } from "@tarojs/components";
import Taro from "@tarojs/taro";
import "./index.scss";
export default ({ show = false, children, onClose, closeBtn = true, zIndex = 10000000001 }) => {
  return (
    <View
      className={`Drawer_box ${show ? 'Drawer_box_show' : 'Drawer_box_close'}`}
      catchMove
      style={{ zIndex: zIndex }}
      onClick={(e) => {
        e.stopPropagation();
        onClose && onClose();
      }}
    >
      <View
        onClick={(e) => {
          e.stopPropagation();
        }}
      >
        {children}
        {closeBtn && (
          <View
            className="Drawer_close_box"
            onClick={() => onClose && onClose()}
          ></View>
        )}
      </View>
    </View>
  );
};
